<template>
  <div>
      
      <van-field label="标题" v-model="form.title" placeholder="请输入标题"/>
      <van-button @click="add"> 发布 </van-button>

  </div>
</template>

<script>
import axios from 'axios'
export default {
    data(){
        return{
            form:{
                'title':'',
                'userid':localStorage.getItem('uid')
            }
        }
    },


    methods:{

        add(){
            axios.post('newsM',this.form).then(res=>{
                console.log(res);
                this.$toast.success("发布成功")
            })
        }
    }

}
</script>

<style>

</style>